<%@ page language="java" import="java.util.*,util.*" pageEncoding="UTF-8"%>
<%@ page import="com.SmsModule.bean.*,com.SmsModule.dao.*,com.UserModule.bean.*,com.UserModule.dao.*"%>  
<jsp:include page="../head.jsp"></jsp:include>

 <%
				TbUserBean tbUser=(TbUserBean)session.getAttribute("User");
				String inFormName=request.getParameter("inFormName");
				String tabIndex=request.getParameter("tabIndex");
		        String tiaojian=" userId="+tbUser.getUserId();
				List<TbCommonPhrase> SelectSmsTemplateList =new ArrayList();;
				TbSmsTemplateDAO smstemplate=new TbSmsTemplateDAO();
				SelectSmsTemplateList=smstemplate.getTbCommonPhraseAll("tb_CommonPhrase", tiaojian, "createTime");
				request.getSession().setAttribute("SelectSmsTemplateList",SelectSmsTemplateList);
    if(request.getParameter("s")!=null)
	 SelectSmsTemplateList=(ArrayList) session.getAttribute("SelectSmsTemplateList");
	     
	  //---------分页
	    int currentPage=1;
	    
	   if(request.getParameter("Page")!=null)
	    {
	        SelectSmsTemplateList=(ArrayList) session.getAttribute("SelectSmsTemplateList");
	    	currentPage=Integer.parseInt(request.getParameter("Page"));
	    }
%>
<body>
				 <form action="" method="post" id="formthis" name="formthis"   >
					<table width="95%"  class="datalist" id="tbTCP" >
					
						<thead>
							<tr>
								<td width="10%" class="tc">
								请选择
								</td>
								<td width="90%" class="tc">
									短语内容
								</td>
								
							</tr>
						</thead>
						<%
						 if(SelectSmsTemplateList!=null){
						 
						 
							int i=0;  
							//--------------分页
							MyPagination mPage=new MyPagination();
							SelectSmsTemplateList=mPage.getInitPage(SelectSmsTemplateList,currentPage,10);
							if (SelectSmsTemplateList != null && SelectSmsTemplateList.size() > 0) {
							for(int index=0;index<SelectSmsTemplateList.size();index++)
							{
							    TbCommonPhrase tcp=SelectSmsTemplateList.get(index);
							    out.print("<tr><td class='tc'> <input type='radio' name='radioCommonPhrase' value='"+tcp.getPhraseContent()+"' /></td>");
							    out.print("<td>"+tcp.getPhraseContent()+"</td></tr>");
							}			
					   }
					   %>
					   <tr>
					       <td colspan="2" class="tc">
					   <%=mPage.printCtrl("./SmsModule/SelectSmsTemplate.jsp",currentPage,"&inFormName="+inFormName+"&tabIndex="+tabIndex) %>
						    </td>
						</tr>
					    <tr>
					    <%} %>
					    	<td colspan="2" class="tc">
					    		<input type="button" id="butsub" name="butsub" value="选择" onclick="checkformSM('<%=inFormName %>',<%=tabIndex %>)"/>
					    	</td>
					    </tr>
					</table>
				</form>
</body>
</html>